package com.sqf.soft.controller;

import com.sqf.soft.entity.Statement;
import com.sqf.soft.service.IStatementService;
import com.sqf.soft.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("statement")
public class StatementController {

    private IStatementService statementService;

    @Autowired
    public StatementController(IStatementService statementService) {
        this.statementService = statementService;
    }

    @RequestMapping("findStatementByPage")
    public Map<String, Object> findStatementByPage(@RequestBody PageBean pageBean) {
        return statementService.findStatementByPage(pageBean);
    }

    @RequestMapping("createStatement")
    public Map<String, Object> createStatement(@RequestBody Statement statement) {
        return statementService.createStatement(statement);
    }

    @RequestMapping("updateStatement")
    public Map<String, Object> updateStatement(@RequestBody Statement statement) {
        return statementService.updateStatement(statement);
    }

    @RequestMapping("deleteStatement")
    public Map<String, Object> deleteStatement(@RequestBody Statement statement) {
        return statementService.deleteStatement(statement);
    }
}
